﻿<%@ Page Title="系统用户管理" Language="C#" MasterPageFile="~/Shared/FormPage.Master" AutoEventWireup="true"
    CodeBehind="UserAdd.aspx.cs" Inherits="Microsoft.JCI.Portal.SysManage.UserAdd" %>
<%@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <link href="../Content/Tab/tabs.css" rel="stylesheet" type="text/css" />
    <script src="../Content/jquery-1.3.2.js" type="text/javascript"></script>  
    <script type="text/javascript">
     function CheckForm() {
         if (document.getElementById('<%=txtAccount.ClientID %>').value == '') {
             alert('请输入用户帐号!');
             document.getElementById('<%=txtAccount.ClientID %>').focus();
                return false;
            }

            if (document.getElementById('<%=txtPassword.ClientID %>').value == '') {
                document.getElementById('<%=txtPassword.ClientID %>').focus();
                alert('请输入密码!');
                return false;
            }

            if (document.getElementById('<%=txtPassword2.ClientID %>').value == '') {
                document.getElementById('<%=txtPassword2.ClientID %>').focus();
                alert('请输入确认密码!');
                return false;
            }

            if (document.getElementById('<%=txtPassword2.ClientID %>').value != document.getElementById('<%=txtPassword.ClientID %>').value) {
                alert('两次密码输入不一致!');
                return false;
            }
        }
        
        //用Treeview chekbox节点单选的处理事件   
    function TreeSingleSelect(treeID, checkNode) {   
        if (!treeID)   
            return;   
        var objs = document.getElementsByTagName("input");   
        for (var i = 0; i < objs.length; i++) {   
            if (objs[i].type == 'checkbox') {   
                var obj = objs[i];   
                if (obj.id.indexOf(treeID) != -1) {   
                    if (obj != checkNode) {   
                        obj.checked = false;   
                    }   
                }   
            }   
        }   
    }   
    //用于给TreeView的 chebox添加 单击事件(如果要将某一TreeView变为单选择 只需调用下面方法)   
    function SetTreeNodeClickHander(treeID) {   
        var objs = document.getElementsByTagName("input");   
        for (var i = 0; i < objs.length; i++) {   
            if (objs[i].type == 'checkbox') {   
                var obj = objs[i];   
                if (obj.id.indexOf(treeID) != -1) {   
                    objs[i].onclick = function() { TreeSingleSelect(treeID, this); };   
                }   
            }   
        }   
    }
    
    function stopPropagation(e)
        {
            e.cancelBubble = true;
            if (e.stopPropagation)
            {
                e.stopPropagation();
            }
        }
        
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphFormArea" runat="server">
    <table class="mnubar" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td width="9">
                    <img hspace="3" src="../Content/Menu/mnu_vSpacer.gif">
                </td>
                <td class="icMenu" nowrap>
                    <asp:LinkButton ID="lnkbtnSave" runat="server" OnClick="lnkbtnSave_Click" OnClientClick="return CheckForm();"><span class="menu" title="保存"><img class="mnuBtn" src="../Content/Menu/Save_16_blue.gif"><span class="mnuBtn">保存</span></span></asp:LinkButton>
                        <asp:LinkButton ID="lnkbtnUpdate" runat="server" 
                        OnClientClick="return CheckForm();" onclick="lnkbtnUpdate_Click"><span class="menu" title="修改"><img class="mnuBtn" src="../Content/Menu/Save_16_blue.gif"><span class="mnuBtn">修改</span></span></asp:LinkButton>
                    <asp:LinkButton ID="lnkbtnSaveAndClose" runat="server" OnClick="lnkbtnSaveAndClose_Click"
                        OnClientClick="return CheckForm();"><span class="menu" title="保存&amp;关闭" onclick="window.execScript(this.action);"><img class="mnuBtn" src="../Content/Menu/SaveClose_16_blue.gif"><span class="mnuBtn">保存&amp;关闭</span></span></asp:LinkButton>
                    <asp:LinkButton ID="lnkbtnSaveAndNew" runat="server" OnClick="lnkbtnSaveAndNew_Click"
                        OnClientClick="return CheckForm();"><span class="menu" title="保存&amp;新增"><img class="mnuBtn" src="../Content/Menu/SaveNew_16_blue.gif"><span class="mnuBtn">保存&amp;新增</span></span></asp:LinkButton>
                    <img src="../Content/Menu/separator.gif">
                    <span class="menu" title="关闭" onclick="window.close();">
                        <img class="mnuBtn" src="../Content/Menu/Close_16_blue.gif"><span class="mnuBtn">关闭</span></span>
                </td>
            </tr>
        </tbody>
    </table>
    <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
    </div>
    <div id="areaForm" class="area">
        <table cellspacing="0" cellpadding="0" width="100%" height="100%">
            <tbody>
                <tr height="25">
                    <td>
                        <table class="tabBar" cellspacing="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td id="appForm_tabs" valign="bottom" nowrap>
                                        <SPAN class="tab tabOn" tabindex=0 tabID=appForm_tab0>基本资料</SPAN><SPAN class=tab
                                            tabindex=0 tabID=appForm_tab1>用户角色</SPAN>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <hr id="appForm_hrSelectedTab" class="tabGlow">
                        <hr id="appForm_hrGlowTab" class="tabGlow">
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        <div style="display: inline" id="appForm_tab0" class="tab">
                            <table style="table-layout: fixed" id="Section1" cellspacing="0" cellpadding="3"
                                width="100%">
                                <colgroup>
                                    <col width="60">
                                    <col>
                                    <col width="60">
                                    <col>
                                </colgroup>
                                <tbody>
                                    <tr>
                                        <td class="req">
                                            用户帐号
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtAccount" runat="server" CssClass="input" MaxLength="20"></asp:TextBox>
                                        </td>
                                        <td>
                                            姓名
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtUserName" runat="server" CssClass="input" MaxLength="20"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="req">
                                            密码
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtPassword" runat="server" CssClass="input" MaxLength="20" TextMode="SingleLine"
                                                Enabled="false" Text="******"></asp:TextBox>
                                        </td>
                                        <td class="req">
                                            确认密码
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtPassword2" runat="server" CssClass="input" MaxLength="20" TextMode="SingleLine"
                                                Enabled="false" Text="******"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            邮箱
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
                                        </td>
                                        <td>
                                            所属公司
                                        </td>
                                        <td>
                                        <rad:RadComboBox ID="MCompany" runat="server" Width="300px"  Skin="webblue"  Height="300px">
                    <ItemTemplate>
                       <asp:CheckBox runat="server" ID="CheckBox" onclick="stopPropagation(event);" Text="" />
                      <%# DataBinder.Eval(Container.DataItem, "Name")%>
                      <asp:HiddenField Value= ' <%# DataBinder.Eval(Container.DataItem, "CompanyCode") %>' runat="server" ID="MV" />
                    </ItemTemplate>
                    </rad:RadComboBox>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <DIV id=appForm_tab1 class=tab>
                            <table style="table-layout: fixed" id="Table1" cellspacing="0" cellpadding="3" width="100%">
                                <colgroup>
                                    <col width="60">
                                    <col>
                                    <col width="60">
                                    <col>
                                    <tbody>
                                        <tr>
                                            <td class="req">
                                                选择角色
                                            </td>
                                            <td>
                                                <asp:CheckBoxList ID="cblRoles" runat="server">
                                                </asp:CheckBoxList>
                                            </td>
                                        </tr>
                                    </tbody>
                            </table>
                        </DIV>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</asp:Content>
